/*
  Copyright 1996-2000
  Simon Whiteside
 */
package simkin.examples.applet;

import java.awt.*;
import java.awt.event.*;

/**
 * This class shows a simple message box
 */
public class MsgBox extends Dialog implements ActionListener{
    Button ok;
    MsgBox(Frame frame,String msg){
	super(frame, "Message", true);
	setLayout(new BorderLayout());
	add("Center",new Label(msg));
	Panel p = new Panel();
	p.add(ok = new Button("OK"));
	ok.addActionListener(this);
	add("South",p);
	Dimension d = getToolkit().getScreenSize();
	setLocation(d.width/3,d.height/3);
	pack();
	setVisible(true);
    }
    public void actionPerformed(ActionEvent ae){
	if(ae.getSource() == ok) 
	    setVisible(false);
    }
}
